package org.footballmanager.pandafootball.system.form.impl;

import lombok.Getter;
import lombok.Setter;
import org.footballmanager.pandafootball.common.constants.Constants;
import org.footballmanager.pandafootball.system.domain.FootScinfo;
import org.footballmanager.pandafootball.system.form.SearchForm;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;

import java.io.Serializable;

@Getter
@Setter
public class FootScinfoSearchForm extends SearchForm implements Serializable {
    private static final long serialVersionUID = 8090668615941861538L;
    protected Long qyId;
    protected String qyName;
    protected Long userId;

    public Example buildSearchCommond() {
        Example example = new Example(FootScinfo.class);
        Example.Criteria criteria = example.createCriteria();
        if (!StringUtils.isEmpty(userId)) {
            criteria.andEqualTo(Constants.USERID, userId);
        }
        criteria.andEqualTo("delFlag", 0);
        example.orderBy("createTime").desc();
        return example;
    }

}
